package synchronize;

import reentrantlock.Child;
import threadpool.ThreadPoolFactory;

import java.util.concurrent.ExecutorService;

public class SynchronizedDemo {

    public static void main(String[] args) {
        ExecutorService threadPool = ThreadPoolFactory.getThreadPool();
        for (int i = 0; i < 10; i++) {
            threadPool.execute(new Runnable() {
                @Override
                public void run() {
                    Child child = new Child();
                    child.doSomething();
                }
            });
        }
        threadPool.shutdown();
    }
}
